gpg: Rewrite OstreeGpgVerifier to use GPGME
authorMatthew Barnes <mbarnes@redhat.com>
Mon, 2 Mar 2015 16:16:16 +0000 (11:16 -0500)
committerMatthew Barnes <mbarnes@redhat.com>
Fri, 6 Mar 2015 13:22:44 +0000 (08:22 -0500)
commit70cabcea0a120715a07664b7376d9190f6404fa6
tree0be4565142a988cb5ff55af6d1bab85f7c07a392
parentd414ee5852791a3cf4f1c3faac2c605edc3dd5f9
gpg: Rewrite OstreeGpgVerifier to use GPGME

This sets the stage for more advanced signature management.

(Also, talking to GPG over pipes sucks.)

Previously we were spawning gpgv2 with a bunch of --keyring options
for /usr/share/ostree/trusted.gpg.d/ and whatever other keyring files
were explicitly added.  GPGME has no public API for multiple keyrings,
so we work around the issue by setting up a temp directory to serve as
a fake "home" directory for the crypto engine and then concatenate all
the keyring files into a single public keyring (pubring.gpg).

Unfortunately at present we do this on every signature verification.
There's a desire to cache this concatenation, but the problem is the
user may be unprivileged.  So it seems the cache would have to be per
user under $XDG_CACHE_HOME, which OSTree doesn't otherwise use.  I'm
open to suggestions.

We do at least clean up the temp directory when finished, and I have
further API changes planned to OstreeGpgVerifier to help mitigate the
performance impact.
Makefile-libostree.am
src/libostree/ostree-gpg-verifier.c